package day5;

public class Demo {

    public static void main(String[] args) {
//        //创建Person对象
//        Person person = new Person();
//
//        //给属性赋值
////        person.age = -10;
//        person.setAge(20);
//
//        person.name = "非正常人";
//
//        //调用方法展示信息
//        person.show();

        Person person1 = new Person();

        person1.name = "德华";

//        person1.show();
        person1.setAge(18);


        Person person2 = new Person();

        person2.name = "于晏";

        person2.setAge(30);

//        person2.show();

        //调用比较年龄的方法
//        boolean judge = person1.equalsAge(person2);
        boolean judge = person2.equalsAge(person1);
        System.out.println("两个对象年龄相等吗："+judge);;

    }
}
